package top.lishuoboy.lombok.annotation.cleanup;

import lombok.Cleanup;

import java.io.*;
/**
 * @author ：lishuoboy
 */
public class CleanupTest {
    
    private void aaa() throws Exception {
        
        @Cleanup InputStream in = new FileInputStream(new File("D:\\111.txt"));
        @Cleanup OutputStream out = new FileOutputStream(new File(""));
        byte[] b = new byte[10000];
        while (true) {
            int r = in.read(b);
            if (r == -1) {
                break;
            }
            out.write(b, 0, r);
        }
        
    }
}